<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        body {
            background-color: #000;
            min-height: 300vh;
        }
        header {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            display: flex;
            justify-content: space-between;
            align-items: center;
            transition: 0.6s;
            padding: 40px 100px;
            z-index: 100;
        }
        header.sticky {
            padding: 5px 100px;
            background-color: #fff;
        }
        header.sticky .logo,
        header.sticky ul li a {
            color: #000;
        }
        header .logo {
            position: relative;
            font-weight: 700;
            text-decoration: none;
            color: #fff;
            font-size: 2em;
            letter-spacing: 2px;
            transition: 0.6s;
        }
        header ul {
            position: relative;
            display: flex;
            justify-content: center;
            align-items: center;
        }
        header ul li {
            position: relative;
            list-style: none;
        }
        header ul li a {
            position: relative;
            margin: 0 15px;
            text-decoration: none;
            color: #fff;
            letter-spacing: 2px;
            font-weight: 500;
            transition: 0.6s;

        }
        .banner {
            position: relative;
            width: 100%;
            height: 100vh;
            background-color: #000;
        }
    </style>
</head>
<body>
    <header>
        <a href="###" class="logo">Logo</a>
        <ul>
            <li><a href="###">Home</a></li>
            <li><a href="###">About</a></li>
            <li><a href="###">Team</a></li>
            <li><a href="###">Contact</a></li>
            <li><a href="###">Servives</a></li>
        </ul>
    </header>
    <section class="banner"></section>
    <script>
        window.addEventListener('scroll', () => {
            const oHeader = document.querySelector('header');
            oHeader.classList.toggle('sticky', window.scrollY > 5)
        })
    </script>
</body>
</html>